package day22.SecondTest;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

public class BookManage {
    private String id;
    private String name;
    private Date publishTime;
    private Double price;

    public BookManage(String id, String name, String publishTime, Double score) throws ParseException {
        this.id = id;
        this.name = name;
        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        //创建日期值
        this.publishTime = dateFormat.parse(publishTime);
        this.price = score;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPublishTie() {
        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        //创建日期值
        //创建日期、
        String format = dateFormat.format(publishTime);
        return format;
    }

    public void setBirthday(String publishTime) throws ParseException {
        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
        //创建日期值
        this.publishTime = dateFormat.parse(publishTime);
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    @Override
    public String toString() {
        return "Student [" +
                "id=" + id  +
                ", name=" + name  +
                ", birthday=" + getPublishTie() +
                ", score=" + String.format("%.1f", price) +
                ']';
    }
}

class Main {
    public static void main(String[] args) throws ParseException {

        Scanner sc = new Scanner(System.in);
        int i = sc.nextInt();
        Map<String, BookManage> map = new HashMap<>();
        for (int i1 = 0; i1 < i; i1++) {
            String id = sc.next();
            map.put(id, new BookManage(id, sc.next(), sc.next(), sc.nextDouble()));
        }
        List<BookManage> sortedStudents = new ArrayList<>(map.values());
        Collections.sort(sortedStudents, Comparator.comparing(BookManage::getId));
        for (BookManage bookManage : sortedStudents) {
            System.out.println(bookManage);
        }
    }
}
